/**
 * 类型管理
 */
import request from '@/api/request';
import {
    CreateTableRequestData,
    UpdateTableRequestData,
    GetTableRequestData,
    GetTableResponseData
} from './types/type-management';

// 增
export function addTableDataApi(data: CreateTableRequestData) {
    return request({
        url: '/web/api/data/tag/add',
        method: 'post',
        data
    });
}

// 删
export function deleteTableDataApi(id: number) {
    return request({
        url: `/web/api/data/tag/delete/${id}`,
        method: 'delete'
    });
}

// 编辑
export function updateTableDataApi(data: UpdateTableRequestData) {
    return request({
        url: '/web/api/data/tag/update',
        method: 'post',
        data
    });
}

// 查类型管理列表
export function getTableDataApi(data: GetTableRequestData) {
    return request<GetTableResponseData>({
        url: '/web/api/data/tag/search',
        method: 'post',
        data
    });
}
